package com.zmn.brs.starter.support;

import com.zmn.brs.starter.annotation.EnableBusinessRisk;
import com.zmn.brs.starter.configuration.OperateRecordProxyAutoConfiguration;
import org.springframework.context.annotation.AdviceMode;
import org.springframework.context.annotation.AdviceModeImportSelector;
import org.springframework.lang.Nullable;

/**
 * 类描述：模块驱动
 *
 * @author xujie
 * @since 2021/03/15 11:08
 */
public class OperateRecordConfigureSelector extends AdviceModeImportSelector<EnableBusinessRisk> {

    private static final String ASYNC_EXECUTION_ASPECT_CONFIGURATION_CLASS_NAME =
            "com.zmn.brs.starter.configuration.OperateRecordProxyAutoConfiguration.java";


    @Override
    @Nullable
    public String[] selectImports(AdviceMode adviceMode) {

        switch (adviceMode) {

            case PROXY:
                return new String[]{OperateRecordProxyAutoConfiguration.class.getName()};
            case ASPECTJ:
                return new String[]{ASYNC_EXECUTION_ASPECT_CONFIGURATION_CLASS_NAME};
            default:
                return null;
        }
    }


}
